<p id="notice"><%= notice %></p>

<p>
<!--  <b>Title:</b> -->
  <h1><%= @collection %> <%= @book.title %></h1>
</p>

<p>
  <b>Price:</b>
  <%= @book.price %>
</p>

<p>
  <b>Isbn:</b>
  <%= @book.isbn %>
</p>

<p>
  <b>Description:</b>
  <%= @book.description %>
</p>
<%= link_to 'Rate me!', new_book_book_rating_path(@book) %>&emsp;
<%= link_to 'Edit', edit_book_path(@book) %>&emsp;
<%= link_to 'Back', books_path %>
<br />
<hr />
<div id="rates">
<p><h3>Global rate: <%= @book_ratings.map(&:rate).sum/@book_ratings.map(&:rate).size if @book_ratings.map(&:rate).size > 0 %></h3></p>
<br />
<p><h2>User comments:</h2></p>
<% @book_ratings.each do |book_rating|  %>
<div id="rate">
	<p><b>Rate :</b> <%= book_rating.rate %>/5</p>
	<p><b>Comments :</b><%= book_rating.comment %></p>
</div>
<hr />
<% end %>
</div>


